{/* LAYOUT模板 */}
<layout name="layout"/>
{/* LAYOUT模板 */}
{/* import Js,Css */}		
<css href="__CSS__/admin/common.css"/>
<css href="__CSS__/qs-table-1.0.css"/> <!-- tableUI -->
<css href="__CSS__/jquery-ui.css" />
<js href="__JS__/admin/js.util.js"/>	
<js href="__JS__/core/jquery-ui.1.10.4.js" />
<js href="__JS__/core/plugins.js"/>
<js href="__JS__/admin/listTable.js"/>
{/* import js,css */}
<div id="loading"><!--#加载条#--></div>

<include file="Template:position"/>


<form method="post" action="" name="listForm">
	<!-- start goods type list -->
	<div class="list-div" id="listDiv">
		<table id="goodstype-list-table"  class="qs-table" width="100%" cellpadding="3" cellspacing="1" id="listTable">
			<tr class="qs-header">
				<th>商品类型名称</th>
				<th>属性分组</th>
				<th>属性数</th>
				<th>状态</th>
				<th>操作</th>
			</tr>
			<volist name="goods_type_arr" id="goods_type">
			<tr id="tr_{$goods_type.cat_id}" class="data <if condition="($k % 2) eq '0'">even<else/>odd</if> ">
				<td class="first-cell">
					<span onclick="javascript:listTable.edit(this, 'cat_name', {$goods_type.cat_id})">{$goods_type.cat_name}</span>
				</td>
				<td>{$goods_type.attr_group}</td>
				<td align="right">{$goods_type.attr_count}</td>
				<td align="center">
					<img src="__IMG__/admin/<if condition="$goods_type['enabled'] eq '1'">yes<else/>no</if>.gif" >
				</td>
				<td align="center">
					<a href="__APP__/attribute/attribute_list?goods_type={$goods_type.cat_id}" title="属性列表">属性列表</a> |
					<a href="__URL__/mod_goodstype?act=edit&cat_id={$goods_type.cat_id}" title="编辑">编辑</a> |
					<a href="javascript:;" onclick="listTable.remove({$goods_type.cat_id}, '确定删除')" title="{$lang.remove}">删除</a>
				</td>
			</tr>
			</volist>
		</table>
	</div>
</form>

<script>
	/*删除类型*/
	listTable.remove = function(cat_id){
		$.ajax({
			url:'__URL__/ajax_goodstype',
			type:'post',
			dataType:'json',
			data:{action:'del',id:cat_id},
			beforeSend:function(){
				$('#loading').QLoading({text:'操作中...',modal:false,status:'open'});
			},
			success:function(msg){
				if(msg.data == '1'){
					$('#tr_' + cat_id).remove();
					$('#loading').QLoading({img:'happy',text:'操作成功',modal:false,status:'close',time:1.5});				
				}
				else{
					$('#loading').QLoading({img:'sad',text:'操作失败',modal:false,status:'close',time:1.5});
				}
			}
		});
	}
	$(document).ready(function(){
		/* 隔行变色 */
		$('#goodstype-list-table').tableUI();
		/* Initialize Url */
		listTable.init('__URL__/ajax_goodstype');				
	});		
</script>






